package com.jtoon.dao;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import com.jtoon.bean.Comics;
import com.jtoon.util.PMF;

public class TestDao {

	public void addComics(Comics comics){
		PersistenceManager pm = PMF.get().getPersistenceManager();
		try{
			pm.makePersistent(comics);
		}finally{
			pm.close();
		}
	}
	
	public void delComicsAll(){
		PersistenceManager pm = PMF.get().getPersistenceManager();
		try{
			Query query = pm.newQuery(Comics.class);
			List<Comics> comics = (List<Comics>) query.execute();
			pm.deletePersistentAll(comics); 
		}finally{
			pm.close();
		}
	}
	
}
